package com.zhxxfwzx.common.lang;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description TODO
 * @title: RespBean
 * @Author LiJing
 * @Date: 2021/6/129:53 下午
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespBean {
    private Integer status;
    private String msg;
    private Object obj;

    public static RespBean build(){
        return new RespBean();
    }

    public static RespBean ok(String msg){
        return new RespBean(200,msg,null);
    }

    public static RespBean ok(String msg, Object obj){
        return new RespBean(200, msg, obj);
    }

    public static RespBean error(String msg){
        return new RespBean(500, msg, null);
    }
    public static RespBean error(String msg, Object obj){
        return new RespBean(500, msg, obj);
    }

    public static RespBean forbidden(String msg){
        return new RespBean(403, msg, null);
    }

    public static RespBean forbidden(String msg, Object obj){
        return new RespBean(403, msg, obj);
    }

}
